package com.wondertek.poms.core.filter.impl;

import com.wondertek.poms.core.filter.BaseRuleFilter;
import com.wondertek.poms.core.filter.RuleFilterChain;
import com.wondertek.poms.dao.po.Content;
import com.wondertek.poms.dao.po.DefaultPrdSal;
import com.wondertek.poms.dao.po.IRulePo;


/**
 * <p><b>CopyRightCpIdFilter Description:</b> 是否首发过滤器</p>
 * @author douzi
 * <b>DATE</b> 2019年9月27日 下午4:00:58
 */
public class FirstPulishFilter extends BaseRuleFilter {

	@Override
	public void doFilter(IRulePo rule, Content c, RuleFilterChain chain) {
		if (rule instanceof DefaultPrdSal) {
			DefaultPrdSal r = (DefaultPrdSal) rule;
			this.baseFilter(r.getId(), 
					r.getFirstPublish() == null ? null : r.getFirstPublish() + "", 
					c.getPublish(), 
					chain, 
					"是否首发-Publish");
		}

		chain.doFilter(rule, c, chain);
	}

}
